package cn.team.service.impl;

import cn.team.entity.Order;
import cn.team.mapper.OrderMapper;
import cn.team.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Date;
import java.util.List;

@Service
public class OrderServiceImpl implements OrderService {

    @Autowired
    private OrderMapper orderMapper;

    @Override
    public void insertOrder(Order order) {
        orderMapper.insertOrder(order);
    }

    @Override
    public List<Order> selectByParent(String parent) {
        return orderMapper.selectByParent(parent);
    }

    @Override
    public List<Order> selectByParentAndVaild(String parent) {
        return orderMapper.getOrderByParentAndVaild(parent);
    }

    @Override
    public List<Order> selectByTutor(String tutor) {
        return orderMapper.selectByTutor(tutor);
    }

    @Override
    public List<Order> selectByShiXianLike(String shi, String xian) {
        return orderMapper.selectByShiXianLike(shi, xian);
    }

    @Override
    public void deleteById(int id) {
        orderMapper.deleteById(id);
    }

    @Override
    public List<Order> selectValidAppointments(String order ,String username,String shi) {
        return orderMapper.selectValidAppointments(order,username,shi);
    }

    @Override
    public List<Order> selectInvalidAppointments(String order,String username) {
        return orderMapper.selectInvalidAppointments(order,username);
    }

    @Override
    public void updateCommentById(int order) {
        orderMapper.updateCommentById(order);
    }

    @Override
    public Order getOrderById(int id) {
        return orderMapper.getOrderById(id);
    }

    @Override
    public int orderSuccess(int id, String tutor) {
        return orderMapper.orderSuccess(id,tutor);
    }

    @Override
    public List<Order> getRenWu(String username) {
        return orderMapper.getRenWu(username);
    }

    @Override
    public List<Order> getWork(String username) {
        return orderMapper.getWork(username);
    }

    @Override
    public List<Order> getCords(String username) {
        return orderMapper.getCords(username);
    }

    @Override
    public int updateComment(int id, String comment) {
        return orderMapper.updateComment(id,comment);
    }

    @Override
    public int deleteCord(int id) {
        return orderMapper.deleteCord(id);
    }

    @Override
    public int quitRenwu(int id) {
        return orderMapper.quitRenwu(id);
    }

    @Override
    public int quXiaoRenwu(int id) {
        return orderMapper.quXiaoRenwu(id);
    }

    @Override
    public List<Order> searchOrders(String keyword) {
        return orderMapper.searchOrders(keyword);
    }

    @Override
    public List<Order> getCommengts(String tutor) {
        return orderMapper.getComments(tutor);
    }
}
